package com.ruoyi.yljf.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.yljf.domain.Send;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 用户赠送表Mapper接口
 * 
 * @author TATAT
 * @date 2025-03-25
 */
public interface SendMapper extends BaseMapper<Send> {

    @Select("SELECT\n" +
            "  u.* \n" +
            "FROM\n" +
            "  yljf_user u\n" +
            "  LEFT JOIN yljf_send s ON u.user_id = s.receive_user_id \n" +
            "WHERE\n" +
            "  s.user_id = #{userId} \n" +
            "  AND s.order_id = #{orderId};")
    String selectNameByOrderIdAndUserId(@Param("orderId") Long orderId, @Param("userId") String userId);
}
